package com.yanqu.road.entity.activity.ad;

import com.yanqu.road.entity.DataObject;

import java.util.ArrayList;
import java.util.List;

public class AdActivityUserData extends DataObject {
    private long userId;                //玩家编号
    private int activityId;             //活动编号
    private int dailyWatchTimes;        //每日观看次数
    private long firstTotalWatchTimes;        //第一次累计观看次数
    private boolean firstRewardFinish;      //第一次奖励全部领完
    private long secondTotalWatchTimes;  //第二次累计观看次数，第一次达到最大观看次数后，计数到这边
    private long dailyResetTime;        //每日重置时间
    private long lastWatchTime;         //上次观看时间
    private List<Integer> firstRewardList = new ArrayList<>();  //第一次奖励
    private List<Integer> secondRewardList = new ArrayList<>(); //第二次奖励
    private boolean getUnlockReward;      //是否领取解锁奖励

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public int getDailyWatchTimes() {
        return dailyWatchTimes;
    }

    public void setDailyWatchTimes(int dailyWatchTimes) {
        if(this.dailyWatchTimes != dailyWatchTimes) {
            this.dailyWatchTimes = dailyWatchTimes;
            setUpdateOption();
        }
    }

    public long getFirstTotalWatchTimes() {
        return firstTotalWatchTimes;
    }

    public void setFirstTotalWatchTimes(long firstTotalWatchTimes) {
        if(this.firstTotalWatchTimes != firstTotalWatchTimes) {
            this.firstTotalWatchTimes = firstTotalWatchTimes;
            setUpdateOption();
        }
    }

    public boolean isFirstRewardFinish() {
        return firstRewardFinish;
    }

    public void setFirstRewardFinish(boolean firstRewardFinish) {
        if(this.firstRewardFinish != firstRewardFinish) {
            this.firstRewardFinish = firstRewardFinish;
            setUpdateOption();
        }
    }

    public long getSecondTotalWatchTimes() {
        return secondTotalWatchTimes;
    }

    public void setSecondTotalWatchTimes(long secondTotalWatchTimes) {
        if(this.secondTotalWatchTimes != secondTotalWatchTimes) {
            this.secondTotalWatchTimes = secondTotalWatchTimes;
            setUpdateOption();
        }
    }

    public long getDailyResetTime() {
        return dailyResetTime;
    }

    public void setDailyResetTime(long dailyResetTime) {
        if(this.dailyResetTime != dailyResetTime) {
            this.dailyResetTime = dailyResetTime;
            setUpdateOption();
        }
    }

    public long getLastWatchTime() {
        return lastWatchTime;
    }

    public void setLastWatchTime(long lastWatchTime) {
        if(this.lastWatchTime != lastWatchTime) {
            this.lastWatchTime = lastWatchTime;
            setUpdateOption();
        }
    }

    public List<Integer> getFirstRewardList() {
        return firstRewardList;
    }

    public boolean isInFirstRewardList(int index){
        return firstRewardList.contains(index);
    }

    public void setFirstRewardList(List<Integer> firstRewardList) {
        this.firstRewardList = firstRewardList;
        setUpdateOption();
    }

    public void addFirstReward(int index){
        if(!firstRewardList.contains(index)){
            firstRewardList.add(index);
            setUpdateOption();
        }
    }

    public List<Integer> getSecondRewardList() {
        return secondRewardList;
    }

    public boolean isInSecondRewardList(int index){
        return secondRewardList.contains(index);
    }

    public void setSecondRewardList(List<Integer> secondRewardList) {
        this.secondRewardList = secondRewardList;
        setUpdateOption();
    }

    public void addSecondReward(int index){
        if(!secondRewardList.contains(index)){
            secondRewardList.add(index);
            setUpdateOption();
        }
    }

    public boolean isGetUnlockReward() {
        return getUnlockReward;
    }

    public void setGetUnlockReward(boolean getUnlockReward) {
        if(this.getUnlockReward != getUnlockReward) {
            this.getUnlockReward = getUnlockReward;
            setUpdateOption();
        }
    }
}
